/**
 * Author: Dmitry Ustimov
 * Date: 5/22/13
 * Time: 2:03 PM
 */

package com.gmail.dmitryustimov.ms.java7.visitor.classic.work.demo.structure1_2_4_8_16;

public class ElementA extends Element {

    public ElementA() {
        this.elements = new Element[] {
                new ElementA1(),
                new ElementA2()
        };
    }

    public void accept(ElementVisitor visitor) {
        visitor.visit(this);
        for(Element elem : elements) {
            elem.accept(visitor);
        }
    }
}
